<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title>机构端</title>
		<script src="/Public/static/jquery-2.0.3.min.js"></script>
        <link rel="stylesheet" href="__PUBLIC__/Home/css/reset.css">
        <link rel="stylesheet" href="__PUBLIC__/Home/css/style.css">
	</head>

	<body class="agency_box contentBox pos_rel dpflxr">
		<include file="head" />

		<!-- 2.垂直导航 -->
		<div class="navColumn">
			<a href="{:U('Mechanism/user_list')}" <if condition="$cur eq '用户管理'">class="navColumnItem actived dpflxr pos_rel"<else />class="navColumnItem  dpflxr pos_rel"</if> data-type='1'>
				<div class="lineColumn pos_abs"></div>
				<label for="">用户管理</label>
				<div class="rightArrow">
				</div>
			</a>
			<a href="{:U('Mechanism/agent')}" <if condition="$cur eq '经纪人管理'">class="navColumnItem actived dpflxr pos_rel"<else />class="navColumnItem  dpflxr pos_rel"</if>  dpflxr pos_rel" data-type='2'>
				<div class="lineColumn pos_abs"></div>
				<label for="">经纪人管理</label>
				<div class="rightArrow">
				</div>
			</a>
			
			
		</div>
		<!-- 3.垂直导航分类页面 -->
	
		<!-- 3.3 新增用户  -->
		<form action="" method="POST"  class="contentArea tabPage actived">
		<div>
			
			<!-- 3.3.1 新增用户 -->
			<div id="appendEmployee" >
				
				<div class="caTitleBox dpflxr">
					<label for="" class="caTitle ">新增用户</label>	
				</div>
				<div class="card switchPage">
					<label for="" class="cspTitle first">基本信息</label>
					<div class="contentItem upload dpflxr">
						<label for="" class="title">头像：</label>

						<div class="image im">
							<if condition="$info['img'] neq ''"><img src="{$info['img_src']}"></if>
						</div>
						<div class="btn">
							<label for="" id="cc">上传头像</label>
						</div>
						<input type="hidden" name="img" value="{$info['img']}">
					</div>
					<div class="dpflxr">
						<div class="contentItem  dpflxr">
							<label for="" class="title">姓名：</label>
							<input type="text" class="inputBox" name="name" value="{$info['name']}" placeholder="请输入姓名"
								placeholder-style="font-size:16px;line-height:48px;color:#bfa;" />
						</div>
						<div class="contentItem  dpflxr">
							<label for="" class="title">联系方式：</label>
							<input type="text" class="inputBox" name="mobile" value="{$info['mobile']}" placeholder="请输入联系方式"
								placeholder-style="font-size:16px;line-height:48px;color:#bfa;" />
						</div>
						<div class="contentItem  dpflxr">
							<label for="" class="title">性别：</label>
							
							<select name="sex" id="" class="selectBox">
								<option value="1" <if condition="$info['sex'] eq 1">selected</if>>男</option>
								<option value="2" <if condition="$info['sex'] eq 2">selected</if>>女</option>
							</select>
						</div>
						<div class="contentItem  dpflxr">
							<label for="" class="title">婚姻情况：</label>
							
							<select name="marriage" id="" class="selectBox">
								<option value="">请选择</option>
								<option value="1" <if condition="$info['marriage'] eq 1">selected</if>>未婚</option>
								<option value="2" <if condition="$info['marriage'] eq 2">selected</if>>已婚</option>
								<option value="3" <if condition="$info['marriage'] eq 3">selected</if>>离异</option>
							</select>
						</div>
						<div class="contentItem  dpflxr">
							<label for="" class="title">年龄段：</label>
							
							<select name="age_group" id="" class="selectBox">
								<option value="">请选择</option>
								<option value="1" <if condition="$info['age_group'] eq 1">selected</if>>20~30</option>
								<option value="2" <if condition="$info['age_group'] eq 2">selected</if>>30~40</option>
								<option value="3" <if condition="$info['age_group'] eq 3">selected</if>>40~50</option>
								<option value="4" <if condition="$info['age_group'] eq 4">selected</if>>50~60</option>
							</select>
						</div>

						<div class="contentItem  dpflxr">
							<label for="" class="title">车辆情况</label>
							<input type="text" class="inputBox" name="license_plate" value="{$info['license_plate']}" placeholder="请输入车牌号码"
								placeholder-style="font-size:16px;line-height:48px;color:#bfa;" />
						</div>
						<div class="contentItem  dpflxr" >
							<label for="" class="title">居住区域：</label>
							
							<select name="province" id="ci" onchange="pp()" class="selectBox" style="width:calc(780px / 3); margin-right: 20px;">
								<option value="">请选择省</option>
								<volist name="province_list" id="item" >
									<option value="{$item['id']}" <if condition="$info['province'] eq $item['id']">selected</if>>{$item['name']}</option>
								</volist>
							</select>
							<select name="city" id="ar" onchange="ccc()" class="selectBox" style="width:calc(780px / 3); margin-right: 20px;">
								<option value="">请选择市</option>
								<volist name="city_list" id="citem">
									<option value="{$citem['id']}" <if condition="$info['city'] eq $citem['id']">selected</if>>{$citem['name']}</option>
								</volist>
							</select>
							<select name="area" id="aaa" class="selectBox" style="width:calc(780px / 3);">
								<option value="">请选择区</option>
								<volist name="area_list" id="aitem">
									<option value="{$aitem['id']}" <if condition="$info['area'] eq $aitem['id']">selected</if>>{$aitem['name']}</option>
								</volist>
							</select>
						</div>
						<div class="contentItem  dpflxr">
							<label for="" class="title">联系地址：</label>
							<input type="text" class="inputBox" name="address" value="{$info['address']}" placeholder="请输入联系地址门牌号"
								placeholder-style="font-size:16px;line-height:48px;color:#bfa;" />
						</div>
						<div class="contentItem  dpflxr">
							<label for="" class="title">家庭收入：</label>
							<input type="text" class="inputBox" name="income" value="{$info['income']}" placeholder="请输入年收入(万)"
								placeholder-style="font-size:16px;line-height:48px;color:#bfa;" />

						</div>
						
					</div>
					<div class="contentItem shortBox dpflxr">
						<label for="" class="title">家庭情况：</label>
					
						<textarea rows="" cols="" class="textBox" name="family_situation" value="{$info['family_situation']}" placeholder="请输入内容">{$info['family_situation']}</textarea>
					</div>
					
					<label for="" class="cspTitle">需求意向</label>
					<div class="dpflxr">
						<div class="contentItem  dpflxr">
							<label for="" class="title">信息获取：</label>
							
							<select name="information_acquisition" id="" class="selectBox">
								<option value="">请选择</option>
								<option value="1" <if condition="$info['information_acquisition'] eq 1">selected</if>>外出拓客</option>
								<option value="2" <if condition="$info['information_acquisition'] eq 2">selected</if>>全民转介</option>
								<option value="3" <if condition="$info['information_acquisition'] eq 3">selected</if>>渠道转介</option>
								<option value="4" <if condition="$info['information_acquisition'] eq 4">selected</if>>陌电</option>
								<option value="5" <if condition="$info['information_acquisition'] eq 5">selected</if>>其他</option>
							</select>
						</div>
						<div class="contentItem  dpflxr">
							<label for="" class="title">上访渠道：</label>
							
							<select name="petition_channels" id="" class="selectBox">
								<option value="">请选择</option>
								<option value="1" <if condition="$info['petition_channels'] eq 1">selected</if>>自然上访</option>
								<option value="2" <if condition="$info['petition_channels'] eq 2">selected</if>>本人邀约</option>
							</select>
						</div>
						<div class="contentItem  dpflxr">
							<label for="" class="title">认知途径：</label>
							
							<select name="cognitive_approach" id="" class="selectBox">
								<option value="">请选择</option>
								<option value="1" <if condition="$info['cognitive_approach'] eq 1">selected</if>>传单</option>
								<option value="2" <if condition="$info['cognitive_approach'] eq 2">selected</if>>线上</option>
								<option value="3" <if condition="$info['cognitive_approach'] eq 3">selected</if>>线下广告</option>								
							</select>
						</div>
						<div class="contentItem  dpflxr">
							<label for="" class="title">购房用途：</label>
							
<!-- 							<select name="objective" id="" class="selectBox">
								<option value="">请选择</option>
								<option value="1" <if condition="$info['objective'] eq 1">selected</if>>居住</option>
								<option value="2" <if condition="$info['objective'] eq 2">selected</if>>出租</option>
							</select> -->
							<select name="objective" id="" class="selectBox">
								<option value="">请选择</option>
								<volist name="purpose" id="item">
									<option value="{$item}" <if condition="$info['objective'] eq $item">selected</if>>{$item}</option>
								</volist>
							</select>
						</div>
						<div class="contentItem  dpflxr">
							<label for="" class="title">现住房：</label>
							
							<select name="current_housing" id="" class="selectBox">
								<option value="">请选择</option>
								<option value="1" <if condition="$info['current_housing'] eq 1">selected</if>>农村自建房</option>
								<option value="2" <if condition="$info['current_housing'] eq 2">selected</if>>城区租房</option>
								<option value="3" <if condition="$info['current_housing'] eq 3">selected</if>>商品房</option>
								<option value="4" <if condition="$info['current_housing'] eq 4">selected</if>>单位集资房</option>
							</select>
						</div>
						<div class="contentItem  dpflxr">
							<label for="" class="title">意向楼盘：</label>
							
							<select name="floor_id" id="fl" class="selectBox" onchange="ff()">
								<option value="">请选择</option>
								<volist name="floor_list" id="item">
									<option value="{$item['id']}" <if condition="$info['floor_id'] eq $item['id']">selected</if>>{$item['name']}</option>
								</volist>
							</select>
						</div>
						<div class="contentItem  dpflxr">
							<label for="" class="title">意向价格：</label>
							
							<select name="intention_price" id="" class="selectBox">
								<option value="1" <if condition="$info['intention_price'] eq 1">selected</if>>2000-3000元/m²</option>
								<option value="2" <if condition="$info['intention_price'] eq 2">selected</if>>3000-4000元/m²</option>
							</select>
						</div>
						<div class="contentItem  dpflxr">
							<label for="" class="title">意向面积：</label>
							
							<select name="intention_area" id="" class="selectBox">
								<option value="1" <if condition="$info['intention_area'] eq 1">selected</if>>60-90m²</option>
								<option value="2" <if condition="$info['intention_area'] eq 2">selected</if>>90-120m²</option>
								<option value="3" <if condition="$info['intention_area'] eq 3">selected</if>>120-150m²</option>
								<option value="4" <if condition="$info['intention_area'] eq 4">selected</if>>150-180m²</option>
							</select>
						</div>
						<div class="contentItem  dpflxr">
							<label for="" class="title">意向楼栋：</label>
							
							<select name="build_id" id="" class="selectBox">
								<option value="1" <if condition="$info['age_group'] eq 1">selected</if>>1</option>
								<option value="2" <if condition="$info['age_group'] eq 2">selected</if>>2</option>
								<option value="3" <if condition="$info['age_group'] eq 3">selected</if>>3</option>
								<option value="4" <if condition="$info['age_group'] eq 4">selected</if>>4</option>
							</select>
						</div>
						<div class="contentItem  dpflxr">
							<label for="" class="title">意向楼层：</label>
							
							<select name="layer" id="" class="selectBox">
								<option value="1" <if condition="$info['age_group'] eq 1">selected</if>>1</option>
								<option value="2" <if condition="$info['age_group'] eq 1">selected</if>>2</option>
								<option value="3" <if condition="$info['age_group'] eq 1">selected</if>>3</option>
								<option value="4" <if condition="$info['age_group'] eq 1">selected</if>>4</option>
								<option value="5" <if condition="$info['age_group'] eq 1">selected</if>>5</option>
								<option value="6" <if condition="$info['age_group'] eq 1">selected</if>>6</option>
								<option value="7" <if condition="$info['age_group'] eq 1">selected</if>>7</option>
								<option value="8" <if condition="$info['age_group'] eq 1">selected</if>>8</option>
								<option value="9" <if condition="$info['age_group'] eq 1">selected</if>>9</option>
								<option value="10" <if condition="$info['age_group'] eq 1">selected</if>>10</option>
								<option value="11" <if condition="$info['age_group'] eq 1">selected</if>>11</option>
								<option value="12" <if condition="$info['age_group'] eq 1">selected</if>>12</option>
								<option value="13" <if condition="$info['age_group'] eq 1">selected</if>>13</option>
								<option value="14" <if condition="$info['age_group'] eq 1">selected</if>>14</option>
								<option value="15" <if condition="$info['age_group'] eq 1">selected</if>>15</option>
								<option value="16" <if condition="$info['age_group'] eq 1">selected</if>>16</option>
							</select>
						</div>
					</div>
					<div class="contentItem checkBox dpflxr">
							<label for="" class="title">意向户型：</label>
							<div class="checkBoxArea  dpflxr">
								<div class="checkBoxItem dpflxr">
									<input type="checkbox" name="intention_hx[]" value="1" <if condition="$aa eq 1">checked</if>>
									<label>A户型</label>
								</div>
								<div class="checkBoxItem dpflxr">
									<input type="checkbox" name="intention_hx[]" value="2" <if condition="$bb eq 1">checked</if>>
									<label>B户型</label>
								</div><div class="checkBoxItem dpflxr">
									<input type="checkbox" name="intention_hx[]" value="3" <if condition="$cc eq 1">checked</if>>
									<label>C户型</label>
								</div><div class="checkBoxItem dpflxr">
									<input type="checkbox" name="intention_hx[]" value="4" <if condition="$dd eq 1">checked</if>>
									<label>D户型</label>
								</div><div class="checkBoxItem dpflxr">
									<input type="checkbox" name="intention_hx[]" value="5" <if condition="$ee eq 1">checked</if>>
									<label>E户型</label>
								</div>
								
							</div>
							
						
							
					</div>
					<div class="contentItem checkBox dpflxr">
							<label for="" class="title">意向级别：</label>
							<div class="checkBoxArea  dpflxr">
								<div class="checkBoxItem dpflxr">
									<input type="radio" name="intention_level" value="1" <if condition="$info['intention_level'] eq 1">checked</if>>
									<label>必买</label>
								</div>
								<div class="checkBoxItem dpflxr"  >
									<input type="radio" name="intention_level" value="2" <if condition="$info['intention_level'] eq 2">checked</if>>
									<label>高意向</label>
								</div><div class="checkBoxItem dpflxr"  >
									<input type="radio" name="intention_level" value="3" <if condition="$info['intention_level'] eq 3">checked</if>>
									<label>不明确</label>
								</div><div class="checkBoxItem dpflxr"  >
									<input type="radio" name="intention_level" value="4" <if condition="$info['intention_level'] eq 4">checked</if>>
									<label>无意向</label>
								</div>
								
							</div>
							
						
							
					</div>
					<div class="contentItem  dpflxr">
							<label for="" class="title">置业顾问：</label>
							
							<select name="adviser" id="ll" class="selectBox">
								<option>请选择置业顾问</option>
								<volist name="adviser_list" id="item">
									<option value="{$item['id']}" <if condition="$info['adviser'] eq $item['id']">selected</if>>{$item['staff_name']}</option>
								</volist>
							</select>
						</div>
					<div class="contentItem shortBox dpflxr">
						<label for="" class="title">备注说明：</label>
					
						<textarea rows="" cols="" class="textBox" placeholder="请输入内容..." name="remark" value="{$info['remark']}">{$info['remark']}</textarea>
					</div>
					<input type="hidden" name="id" value="{$info['id']}">
					<div><button  type="submit" class="ciBtn">保存</button></div>
				</div>
			</div>
			
					
			
		</div>
		</form>
		
		
	

		
	</body>
</html>
<script type="text/javascript">
	function pp(){

        var id=$('#ci').val();
        $.ajax({
            url:"{:U('Mechanism/city')}",
            data:{id:id},
            dataType:'json',
            type:'post',
            success:function(data){
            	// console.log(data);return false;
                if(data.result=='1'){
                var tt='<option  value="">请选择市</option>';
                $.each(data.data,function(k,v){
                 tt +='<option value='+v.id+'>'+v.name+'</option>';
                });
                $('#ar').html(tt);
            }
            }
        })

	}

		function ccc(){

        var id=$('#ar').val();
        $.ajax({
            url:"{:U('Mechanism/area')}",
            data:{id:id},
            dataType:'json',
            type:'post',
            success:function(data){
            	// console.log(data);return false;
                if(data.result=='1'){
                var tt='<option  value="">请选择区</option>';
                $.each(data.data,function(k,v){
                 tt +='<option value='+v.id+'>'+v.name+'</option>';
                });
                $('#aaa').html(tt);
            }
            }
        })

	}

	function ff(){

        var id=$('#fl').val();
        $.ajax({
            url:"{:U('Mechanism/adviser_list')}",
            data:{floor_id:id},
            dataType:'json',
            type:'post',
            success:function(data){
            	// console.log(data);return false;
                if(data.result=='1'){
                var tt='<option  value="">请选择置业顾问</option>';
                $.each(data.data,function(k,v){
                 tt +='<option value='+v.id+'>'+v.staff_name+'</option>';
                });
                $('#ll').html(tt);
            }
            }
        })

	}



	$("body").on('click','#cc',function(){
	// alert('123');
    var thisObj = $(this);
    var inputFile = document.createElement("input");
    inputFile.type = "file";
    inputFile.name = "file[]";
    inputFile.multiple = "multiple";
    inputFile.accept = "image/jpeg,image/jpg,image/png";
    inputFile.click();
    $(inputFile).change(function(){
        var files = inputFile.files;
        for(var i=0;i<files.length;i++){
            uploadImg(files[i],thisObj);
        }
    });
});
function uploadImg(file,thisObj){
    var formData = new FormData();
    formData.append('image', file);
    $.ajax({
        url: "{:U('Mechanism/uploadImg')}",
        type: "post",
        data: formData,
        dataType:"json",
        contentType: false,
        processData: false,
        mimeType: "multipart/form-data",
        success: function (data) {
            if(data.code == 0){
            　　console.log(data.info.imgid);
                var imgid=data.info.imgid;
            	$("input[name='img']").val(imgid);
            	var img=data.info.imgurl;
            	$('.im').html('<img src="'+img+'"/>');

　　　　　　　}
        },
    });
}

</script>